import request from "@/utils/request";

/**
 * 获取用户信息
 */
export function getPerson() {
  return request<{
    info: User.Info;
    menus: Menu.Item[];
  }>({
    url: "/admin/base/comm/person",
    method: "GET",
  });
}

export function getUserList() {
  return request({
    url: "/admin/base/sys/user/list",
    method: "POST",
  });
}

export function getUserPage(data: Common.PaginationParams) {
  return request<{
    list: User.Info[];
    pagination: Common.Pagination;
  }>({
    url: "/admin/base/sys/user/page",
    method: "POST",
    data,
  });
}

export function addUser(data: unknown) {
  return request({
    url: "/admin/base/sys/user/add",
    method: "POST",
    data,
  });
}

export function updateUser(data: unknown) {
  return request({
    url: "/admin/base/sys/user/update",
    method: "POST",
    data,
  });
}

export function deleteUser(data: unknown) {
  return request({
    url: "/admin/base/sys/user/delete",
    method: "POST",
    data,
  });
}
